<template>
  <div>
      
    <el-breadcrumb separator="/">
      <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>用户管理</el-breadcrumb-item>
      <el-breadcrumb-item>权限列表</el-breadcrumb-item>
    </el-breadcrumb>
    <el-card class="box-card">
      

      <template >
        <el-table :data="rightList" style="width: 100%" border stripe>
            
          <el-table-column type="index" label="#"> </el-table-column>
          <el-table-column prop="authName" label="权限名称" >
          </el-table-column>
          <el-table-column prop="path" label="路径" >
          </el-table-column>
          <el-table-column prop="level" label="权限等级" >
              <template slot-scope="scope">
              <el-tag v-if="scope.row.level==='0'">一级</el-tag>
              <el-tag type="success" v-if="scope.row.level==='1'">二级</el-tag>
              <el-tag type="warning" v-if="scope.row.level==='2'">三级</el-tag>
              <!-- <el-tag :type="computedType(scope.row.level)" >{{scope.row.level}}级</el-tag> -->
              </template>
          </el-table-column>
          
         
        </el-table>
      </template>
      <!-- <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="queryInfo.pagenum"
        :page-sizes="[1, 2, 5, 10]"
        :page-size="queryInfo.pagesize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="total"
      >
      </el-pagination> -->
    </el-card>
  
  </div>
</template>
<script>
export default {
    created(){
        this.getRightList()
    },
    data(){
        return{
            rightList:[],

        }
    },
    methods:{
        getRightList(){
            this.$http.get(`rights/list`).then(res=>{
                if(res.data.meta.status===200){
                    this.rightList=res.data.data
                }
                else{
                    this.$message.console.error("获取失败");
                }
            })
        },
        //   computedType(level){
        //     if(level==='0'){
        //         return

        //     }
        //     else if(level==='1'){
        //         return "success"
        //     }
        //     else if(level==='2'){
        //         return "warning"
        //     }
        // }
          
    },
    computed:{
   
    }
    
}
</script>

<style lang="less" scoped>

</style>

